import request from 'network/index'

//提交预约
export function addHouseComment(data) {
  return request({
    method: "post",
    url: "/order",
    data
  })
}

//取消预约
export function cancleAppointment(params) {
  return request({
    method: "put",
    url: "/order/noSuccess",
    params
  })
}


//预约的时候查看房子信息+房主信息
export function appointmentHouse(params) {
  return request({
    url: "/house/rentin",
    params
  })
}

//提交预约
export function submitAppointment(data) {
  return request({
    method: "post",
    url: "/order",
    data
  })
}

//查看自己预约房间的情况
export function getMyAppointmentState(params) {
  return request({
    url: "/order",
    params
  })
}

//获取预约的详情
export function getAppointmentDetail(orderId) {
  return request({
    url: "/order/" + orderId,
  })
}

//判断当前登录的人是否能够预约(如果预约过就不能预约了)
export function isAppointmentHouse(params){
  return request({
    url:"/order/judge",
    params
  })
}

//房东(角度) 查看自己房子是否被预约的情况
export function rentOutUserHouseAppointmentInfo(params){
  return request({
    url:"/order/treated",
    params
  })
}

//客户提交了预约,房主确认预约
export function rentOutUserAffitmAppointment(params){
  return request({
    method:"put",
    url:"/order/check",
    params
  })
}
